﻿#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using starLiGHT.ParticleSystem.Common;
using starLiGHT.ParticleSystem.twoD;
using Microsoft.Xna.Framework.Content;
using starLiGHT.ParticleSystem.PulseGenerators;
using starLiGHT.ParticleSystem.Initializer;
using starLiGHT.ParticleSystem.Initializer.TwoD;
using starLiGHT.ParticleSystem.Modifier;
using starLiGHT.ParticleSystem.Modifier.twoD;
using System.Collections.Generic;
using starLiGHT.Collections;
#endregion

namespace starLiGHT.Sandbox.Particles
{
    public class Fire : Emitter2D
    {
        public Fire(ContentManager content)
            : base("Fire")
        {
            PulseGenerator = new starLiGHT.ParticleSystem.PulseGenerators.Random(300, 500);

            List<WeightValuePair<Texture2D>> textures = new List<WeightValuePair<Texture2D>>();
            textures.Add(new WeightValuePair<Texture2D>(33.33f, content.Load<Texture2D>("fire03")));
            textures.Add(new WeightValuePair<Texture2D>(33.33f, content.Load<Texture2D>("fire02")));
            textures.Add(new WeightValuePair<Texture2D>(33.33f, content.Load<Texture2D>("fire01")));
            addInitializer(new starLiGHT.ParticleSystem.Initializer.RandomTexture(textures));
            
            addInitializer(new Lifetime(1, 3.5f));
            addInitializer(new Velocity(new DiscSectorRegion(new Vector2(0, 0), 20, 10, -(float)Math.PI, 10)));
            addInitializer(new Position(new LineRegion(new Vector2(300, 600), new Vector2(500, 600))));
            addInitializer(new RotateVelocity(-0.25f, 0.25f));
            addInitializer(new starLiGHT.ParticleSystem.Initializer.Scale(0.25f));
            addInitializer(new ColorInitializer(new Color(255, 204, 100, 255), new Color(255, 0, 0, 255)));

            addModifier(new Age());
            addModifier(new Move());
            addModifier(new Rotate());
            addModifier(new LinearDrag(0.75f));
            addModifier(new Accelerate(0, -60));
            addModifier(new ChangeColor(new Color(167, 82, 50, 128), new Color(250, 50, 0, 0)));
            addModifier(new RandomDrift(new Vector2(30, -120)));
            //addModifier(new Fade(1.00f, 0.0f));
            addModifier(new starLiGHT.ParticleSystem.Modifier.Scale(0.20f, 0.05f));
        }
    }
}
